<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBridgesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bridges', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('age_id')->default()->comment('年代ID');
            $table->unsignedInteger('type_id')->default()->comment('类型ID');
            $table->unsignedInteger('level_id')->default()->comment('级别ID');
            $table->string('bridge_name')->comment('古桥名称');
            $table->string('front_cover')->comment('封面照片');
            $table->decimal('longitude', 10, 7)->default(0)->comment('经度');
            $table->decimal('latitude', 10, 7)->default(0)->comment('维度');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bridges');
    }
}
